home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 6696 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.6 KB

  1. Path: fas-news.harvard.edu!usenet
  2. From: Kwin Kramer <khkramer@bitwise.net>
  3. Newsgroups: comp.lang.misc,comp.lang.perl.misc,comp.lang.tcl,comp.lang.c,comp.lang.java
  4. Subject: Re: Readable Perl (was: Re: Relative Speed of Perl vs. Tcl vs. C)
  5. Date: Fri, 16 Feb 1996 19:21:03 -0500
  6. Organization: Harvard University, Cambridge, Massachusetts
  7. Message-ID: <31251F6F.1F23@bitwise.net>
  8. References: <4e3a2u$eoa@wcap.centerline.com> <JTV2J.96Feb12142743@mamba.cs.virginia.edu> <ukd97hwzkc.fsf_-_@linda.teleport.com> <4g23sv$dht@alpine.valleynet.com> <4g31jn$q71@csnews.cs.colorado.edu>
  9. NNTP-Posting-Host: khkramer.student.harvard.edu
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 2.0 (Win95; I)
  14.  
  15. Tom Christiansen wrote:
  16.  
  17. > The "when it's not possible case" is demonstrated here:
  18. >     while (<>) { # YANETUT
  19. >         s/^(([A-Z].*?)(:.*?)*?)(:\s*)?\n//
  20. >             and ($3 || $4 ? $card : $sect) = $1;
  21. >         next if /^\s*[=-]/;
  22. >         for (split /\n(?=  \S|\+)/) {
  23. >             s/\s+/ /g; s/^ //;
  24. >             $new = s/^\+\s+// ? '+' : '';
  25. >             next if $opt_n and !$new;
  26. >             s/([a-z]\.) ([A-Z])/$1\n$2/g if $opt_s;
  27. >             if ( ($opt_e ? $card : $_) =~ /$query/o ||
  28. >                     (!$opt_e && $opt_h && $card =~ /$query/o))
  29. > >>>>        {
  30. >                 s/\n/ /g if $opt_s;
  31. >                 $matches++;
  32. >                 write;
  33. >                 ($psect, $pcard) = ($sect, $card);
  34. >             }
  35. >         }
  36. >     }
  37.  
  38. I love Perl. It's my favorite language, etc. But perhaps the above code 
  39. fragment doesn't really help with the readability argument <grin>.
  40.  
  41. Kwin
  42.